home *** CD-ROM | disk | FTP | other *** search
/ Merciful 5 / Merciful - Disc 5.iso / software / p / pcqpascalv1.2d.lha / Include / Devices / InputEvent.i < prev    next >
Text File  |  1997-05-06  |  9KB  |  264 lines

  1. {
  2.         InputEvent.i for PCQ Pascal
  3.  
  4.         input event definitions
  5. }
  6.  
  7. {$I "Include:Devices/Timer.i"}
  8. {$I "Include:Intuition/Screens.i"}
  9. {$I "Include:Utility/Hooks.i"}
  10.  
  11. const
  12.  
  13. {------ constants -------------------------------------------------}
  14.  
  15. {   --- InputEvent.ie_Class --- }
  16. { A NOP input event }
  17.     IECLASS_NULL        = $00;
  18. { A raw keycode from the keyboard device }
  19.     IECLASS_RAWKEY      = $01;
  20. { The raw mouse report from the game port device }
  21.     IECLASS_RAWMOUSE    = $02;
  22. { A private console event }
  23.     IECLASS_EVENT       = $03;
  24. { A Pointer Position report }
  25.     IECLASS_POINTERPOS  = $04;
  26. { A timer event }
  27.     IECLASS_TIMER       = $06;
  28. { select button pressed down over a Gadget (address in ie_EventAddress) }
  29.     IECLASS_GADGETDOWN  = $07;
  30. { select button released over the same Gadget (address in ie_EventAddress) }
  31.     IECLASS_GADGETUP    = $08;
  32. { some Requester activity has taken place.  See Codes REQCLEAR and REQSET }
  33.     IECLASS_REQUESTER   = $09;
  34. { this is a Menu Number transmission (Menu number is in ie_Code) }
  35.     IECLASS_MENULIST    = $0A;
  36. { User has selected the active Window's Close Gadget }
  37.     IECLASS_CLOSEWINDOW = $0B;
  38. { this Window has a new size }
  39.     IECLASS_SIZEWINDOW  = $0C;
  40. { the Window pointed to by ie_EventAddress needs to be refreshed }
  41.     IECLASS_REFRESHWINDOW = $0D;
  42. { new preferences are available }
  43.     IECLASS_NEWPREFS    = $0E;
  44. { the disk has been removed }
  45.     IECLASS_DISKREMOVED = $0F;
  46. { the disk has been inserted }
  47.     IECLASS_DISKINSERTED = $10;
  48. { the window is about to be been made active }
  49.     IECLASS_ACTIVEWINDOW = $11;
  50. { the window is about to be made inactive }
  51.     IECLASS_INACTIVEWINDOW = $12;
  52. { extended-function pointer position report (V36) }
  53.     IECLASS_NEWPOINTERPOS  = $13;
  54. { Help key report during Menu session (V36) }
  55.     IECLASS_MENUHELP       = $14;
  56. { the Window has been modified with move, size, zoom, or change (V36) }
  57.     IECLASS_CHANGEWINDOW   = $15;
  58.  
  59.  
  60.  
  61. { the last class }
  62.  
  63.     IECLASS_MAX         = $15;
  64.  
  65. {  --- InputEvent.ie_SubClass --- }
  66. {  IECLASS_NEWPOINTERPOS }
  67. {      like IECLASS_POINTERPOS }
  68.  IESUBCLASS_COMPATIBLE  = $00;
  69. {      ie_EventAddress points to struct IEPointerPixel }
  70.  IESUBCLASS_PIXEL       = $01;
  71. {      ie_EventAddress points to struct IEPointerTablet }
  72.  IESUBCLASS_TABLET      = $02;
  73.  
  74. { pointed to by ie_EventAddress for IECLASS_NEWPOINTERPOS,
  75.  * and IESUBCLASS_PIXEL.
  76.  *
  77.  * You specify a screen and pixel coordinates in that screen
  78.  * at which you'd like the mouse to be positioned.
  79.  * Intuition will try to oblige, but there will be restrictions
  80.  * to positioning the pointer over offscreen pixels.
  81.  *
  82.  * IEQUALIFIER_RELATIVEMOUSE is supported for IESUBCLASS_PIXEL.
  83.  }
  84. Type
  85.    iepp_Position_Struct = Record
  86.     x,y : Short;
  87.    END;
  88.  
  89.    IEPointerPixel = Record
  90.     iepp_Screen : ScreenPtr;   { pointer to an open screen }
  91.     iepp_Position : iepp_Position_Struct;
  92.    END;
  93.    IEPointerPixelPtr = ^IEPointerPixel;
  94.  
  95. { pointed to by ie_EventAddress for IECLASS_NEWPOINTERPOS,
  96.  * and IESUBCLASS_TABLET.
  97.  *
  98.  * You specify a range of values and a value within the range
  99.  * independently for each of X and Y (the minimum value of
  100.  * the ranges is always normalized to 0).
  101.  *
  102.  * Intuition will position the mouse proportionally within its
  103.  * natural mouse position rectangle limits.
  104.  *
  105.  * IEQUALIFIER_RELATIVEMOUSE is not supported for IESUBCLASS_TABLET.
  106.  }
  107.    iept_Range_Struct = Record
  108.     x,y : Short;
  109.    END;
  110.    iept_Value_Struct = Record
  111.     x,y : Short;
  112.    END;
  113.  
  114.  
  115.    IEPointerTablet = Record
  116.     iept_Range : iept_Range_Struct;     { 0 is min, these are max      }
  117.     iept_Value : iept_Value_Struct;     { between 0 AND iept_Range     }
  118.  
  119.     iept_Pressure : Short;  { -128 to 127 (unused, set to 0)  }
  120.    END;
  121.    IEPointerTabletPtr = ^IEPointerTablet;
  122.  
  123. { The ie_EventAddress of an IECLASS_NEWPOINTERPOS event of subclass
  124.  * IESUBCLASS_NEWTABLET points at an IENewTablet structure.
  125.  *
  126.  *
  127.  * IEQUALIFIER_RELATIVEMOUSE is not supported for IESUBCLASS_NEWTABLET.
  128.  }
  129.  
  130.  IENewTablet = Record
  131.     { Pointer to a hook you wish to be called back through, in
  132.      * order to handle scaling.  You will be provided with the
  133.      * width and height you are expected to scale your tablet
  134.      * to, perhaps based on some user preferences.
  135.      * If NULL, the tablet's specified range will be mapped directly
  136.      * to that width and height for you, and you will not be
  137.      * called back.
  138.      }
  139.     ient_CallBack : HookPtr;
  140.  
  141.     { Post-scaling coordinates and fractional coordinates.
  142.      * DO NOT FILL THESE IN AT THE TIME THE EVENT IS WRITTEN!
  143.      * Your driver will be called back and provided information
  144.      * about the width and height of the area to scale the
  145.      * tablet into.  It should scale the tablet coordinates
  146.      * (perhaps based on some preferences controlling aspect
  147.      * ratio, etc.) and place the scaled result into these
  148.      * fields.  The ient_ScaledX and ient_ScaledY fields are
  149.      * in screen-pixel resolution, but the origin ( [0,0]-point )
  150.      * is not defined.  The ient_ScaledXFraction and
  151.      * ient_ScaledYFraction fields represent sub-pixel position
  152.      * information, and should be scaled to fill a UWORD fraction.
  153.      }
  154.     ient_ScaledX, ient_ScaledY,
  155.     ient_ScaledXFraction, ient_ScaledYFraction : WORD;
  156.  
  157.     { Current tablet coordinates along each axis: }
  158.     ient_TabletX, ient_TabletY : Integer;
  159.  
  160.     { Tablet range along each axis.  For example, if ient_TabletX
  161.      * can take values 0-999, ient_RangeX should be 1000.
  162.      }
  163.     ient_RangeX, ient_RangeY : Integer;
  164.  
  165.     { Pointer to tag-list of additional tablet attributes.
  166.      * See <intuition/intuition.h> for the tag values.
  167.      }
  168.     ient_TagList : Address;
  169.  end;
  170.  IENewTabletPtr = ^IENewTablet;
  171.  
  172.  
  173. CONST
  174. {   --- InputEvent.ie_Code ---   }
  175. { IECLASS_RAWKEY }
  176.     IECODE_UP_PREFIX            = $80;
  177.     IECODE_KEY_CODE_FIRST       = $00;
  178.     IECODE_KEY_CODE_LAST        = $77;
  179.     IECODE_COMM_CODE_FIRST      = $78;
  180.     IECODE_COMM_CODE_LAST       = $7F;
  181.  
  182. { IECLASS_ANSI }
  183.     IECODE_C0_FIRST             = $00;
  184.     IECODE_C0_LAST              = $1F;
  185.     IECODE_ASCII_FIRST          = $20;
  186.     IECODE_ASCII_LAST           = $7E;
  187.     IECODE_ASCII_DEL            = $7F;
  188.     IECODE_C1_FIRST             = $80;
  189.     IECODE_C1_LAST              = $9F;
  190.     IECODE_LATIN1_FIRST         = $A0;
  191.     IECODE_LATIN1_LAST          = $FF;
  192.  
  193. { IECLASS_RAWMOUSE }
  194.     IECODE_LBUTTON              = $68;  { also uses IECODE_UP_PREFIX }
  195.     IECODE_RBUTTON              = $69;
  196.     IECODE_MBUTTON              = $6A;
  197.     IECODE_NOBUTTON             = $FF;
  198.  
  199. { IECLASS_EVENT }
  200.     IECODE_NEWACTIVE            = $01;  { active input window changed }
  201.     IECODE_NEWSIZE              = $02;  { resize of window }
  202.     IECODE_REFRESH              = $03;  { refresh of window }
  203.  
  204. { IECLASS_REQUESTER Codes }
  205. { REQSET is broadcast when the first Requester (not subsequent ones) opens
  206.  * in the Window
  207.  }
  208.     IECODE_REQSET               = $01;
  209. { REQCLEAR is broadcast when the last Requester clears out of the Window }
  210.     IECODE_REQCLEAR             = $00;
  211.  
  212.  
  213. {   --- InputEvent.ie_Qualifier --- }
  214.     IEQUALIFIER_LSHIFT          = $0001;
  215.     IEQUALIFIER_RSHIFT          = $0002;
  216.     IEQUALIFIER_CAPSLOCK        = $0004;
  217.     IEQUALIFIER_CONTROL         = $0008;
  218.     IEQUALIFIER_LALT            = $0010;
  219.     IEQUALIFIER_RALT            = $0020;
  220.     IEQUALIFIER_LCOMMAND        = $0040;
  221.     IEQUALIFIER_RCOMMAND        = $0080;
  222.     IEQUALIFIER_NUMERICPAD      = $0100;
  223.     IEQUALIFIER_REPEAT          = $0200;
  224.     IEQUALIFIER_INTERRUPT       = $0400;
  225.     IEQUALIFIER_MULTIBROADCAST  = $0800;
  226.     IEQUALIFIER_MIDBUTTON       = $1000;
  227.     IEQUALIFIER_RBUTTON         = $2000;
  228.     IEQUALIFIER_LEFTBUTTON      = $4000;
  229.     IEQUALIFIER_RELATIVEMOUSE   = $8000;
  230.  
  231.     IEQUALIFIERB_LSHIFT         = 0;
  232.     IEQUALIFIERB_RSHIFT         = 1;
  233.     IEQUALIFIERB_CAPSLOCK       = 2;
  234.     IEQUALIFIERB_CONTROL        = 3;
  235.     IEQUALIFIERB_LALT           = 4;
  236.     IEQUALIFIERB_RALT           = 5;
  237.     IEQUALIFIERB_LCOMMAND       = 6;
  238.     IEQUALIFIERB_RCOMMAND       = 7;
  239.     IEQUALIFIERB_NUMERICPAD     = 8;
  240.     IEQUALIFIERB_REPEAT         = 9;
  241.     IEQUALIFIERB_INTERRUPT      = 10;
  242.     IEQUALIFIERB_MULTIBROADCAST = 11;
  243.     IEQUALIFIERB_MIDBUTTON      = 12;
  244.     IEQUALIFIERB_RBUTTON        = 13;
  245.     IEQUALIFIERB_LEFTBUTTON     = 14;
  246.     IEQUALIFIERB_RELATIVEMOUSE  = 15;
  247.  
  248.  
  249. {------ InputEvent ------------------------------------------------}
  250.  
  251. type
  252.  
  253.     InputEvent = record
  254.         ie_NextEvent    : ^InputEvent;  { the chronologically next event }
  255.         ie_Class        : Byte;         { the input event class }
  256.         ie_SubClass     : Byte;         { optional subclass of the class }
  257.         ie_Code         : Short;        { the input event code }
  258.         ie_Qualifier    : Short;        { qualifiers in effect for the event}
  259.         ie_addr_xy      : Integer;      { addr or pointer position }
  260.         ie_TimeStamp    : TimeVal;      { the system tick at the event }
  261.     end;
  262.     InputEventPtr = ^InputEvent;
  263.  
  264.